﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MapRoom
{
    class MapModelUpdateData
    {
        private string _robotID;
        private double _forwardMeasurement;
        private double _starboardMeasurement;
        private bool _doorStart;
        private bool _doorEnd;
        private bool _inSpinMode;
        private bool _inResetMode;
        private double _approximateAngle;

        public bool doorStart
        {
            get { return _doorStart; }
            set { _doorStart = value; }
        }

        public bool doorEnd
        {
            get { return _doorEnd; }
            set { _doorEnd = value; }
        }

        public bool inSpinMode
        {
            get { return _inSpinMode; }
            set { _inSpinMode = value; }
        }

        public bool inResetMode
        {
            get { return _inResetMode; }
            set { _inResetMode = value; }
        }

        public double approximateAngle
        {
            get { return _approximateAngle; }
            set { _approximateAngle = value; }
        }

        public string robotID
        {
            get { return _robotID; }
            set { _robotID = value; }
        }

        public double forwardMeasurement
        {
            get { return _forwardMeasurement; }
            set { _forwardMeasurement = value; }
        }

        public double starboardMeasurement
        {
            get { return _starboardMeasurement; }
            set { _starboardMeasurement = value; }
        }

       public MapModelUpdateData( string robotID, double forwardMeasurement, double starboardMeasurement,
            bool doorStart, bool doorEnd, bool inSpinMode, double approximateAngle, bool inResetMode )
        {
            this.robotID = robotID;
            this.forwardMeasurement = forwardMeasurement;
            this.starboardMeasurement = starboardMeasurement;
            this.doorStart = doorStart;
            this.doorEnd = doorEnd;
            this.inSpinMode = inSpinMode;
            this.approximateAngle = approximateAngle;
            this.inResetMode = inResetMode;
        }

       public MapModelUpdateData( XBeeMessage xBeeMessage )
       {
           this.robotID = xBeeMessage.robotID;
           this.forwardMeasurement = xBeeMessage.forwardMeasurement;
           this.starboardMeasurement = xBeeMessage.starboardMeasurement;
           this.approximateAngle = xBeeMessage.approximateAngle;
           if( xBeeMessage.modeOfRobot == 1 )
           {
               this.inSpinMode = true;
               this.inResetMode = false;
           }
       }
    
    }
}
